Send dataset images through a flow
The from-dataset node brings the images of a dataset of your project into a flow on the controller: one at random each time it is asked, or the whole dataset one after another. It is the quickest way to try a flow or a model with real images before a camera is connected.
What you will learn
- How to connect a flow to the datasets of your project
- How to choose a dataset and filter its images by tag or split
- How to see the images a flow receives
- How to stream a whole dataset, and pause or stop it
Before you start
You need a controller linked to your project and a dataset with images. The basics of the editor are in Introduction to Node-RED. Here the flow already has an inject node to start it.
1. Add a from-dataset node
Type from-dataset in «filter nodes», at the top of the palette, and drag the node next to the inject node. Then drag from the output of the inject node to the input of the new one.

2. Connect it to your project
Double-click the node. In «Firebase configuration», choose the connection the controller uses to reach your project, here «Rosepetal Firebase». It is set up with the controller, and from then on every node of the controller can use it.

3. Choose the dataset
Leave «Retrieval mode» on «Fetch on demand»: each message that reaches the node brings one image of the dataset, at random. Choose the dataset in «Dataset». «Tag» and «Set» narrow the images down to one tag or one split, and next to each tag you see how many images it has. The image travels in the field set in «Output field», msg.image by default.

4. Add a node to see the images
An image arrives as raw pixels, which the debug panel cannot show. Every Rosepetal image node can: add one after from-dataset, here rp-resize. Open it, set «Input from» to msg.image, where from-dataset puts the image, a «Width» of 400 pixels, and tick «Debug»: the node shows each image it passes on, under it.

5. Deploy and bring an image
Click «Deploy» and press the button of the inject node. The node fetches an image of the dataset and passes it on. Press again for another one, chosen at random.

6. Bring another one
Each press brings another image, chosen at random.
7. Stream the whole dataset
Open from-dataset again and choose «Stream entire dataset» in «Retrieval mode». The node then sends every image of the dataset, one after another, with the pause set in «Interval (ms)» between them. It answers three commands in msg.payload: start, pause and stop.

8. Send start
Close the dialog and open the inject node. Set msg.payload to the text start.

9. Add a stop button
Add another inject node, set its payload to the text stop and wire it to from-dataset. pause stops the stream where it is, and the next start goes on from there; stop starts it again from the first image.
10. Start the stream
Deploy and press the «start» inject node. The status under from-dataset counts the images sent out of the total, and the preview changes with each one.

11. Stop it
Press the «stop» inject node. The stream ends, and the next start begins again from the first image.
Good to know
- Pre-download images. The third mode downloads a set number of images when the flow starts (up to 50) and serves them from memory, the fastest way to feed a flow over and over.
- Use msg properties. Tick it to choose the dataset, tag and set in each message instead of in the dialog, for a flow that switches between datasets.
- The list of datasets. The
list-datasetnode sends the datasets of the project, with their tags and how many images each has, when the flow starts and every time they change. It is what a panel uses to offer a dataset to choose from. - Downloads per day. Each Firebase connection downloads at most 5,000 images a day, counted from the first one.
Next steps
Recorded on Rosepetal release 1.8.15, Node-RED 5.0.10.